﻿use adventureworks

/*DECLARE	@return_value int

EXEC	@return_value = spExecScriptAndCreateTable '[dbo].[uspGetWhereUsedProductID] @StartProductID = NULL,@CheckDate = NULL','TesztForExec','x int,y int','1,2',1

select * from TesztForExec
*/
/*
EXECUTE [AdventureWorks].[dbo].[spExecScriptAndCreateTable] 
   @executeSql='EXEC adventureworks.dbo.t1'
  ,@DestDbName='tempdb'
  ,@tableName='tttt'
  ,@additionalFieldNames='i int identity(1,1)'
  ,@additionalFieldValues='1'
  ,@enums=3

*/

EXECUTE [AdventureWorks].[dbo].[spExecScriptAndCreateTable] 
   @executeSql='EXEC adventureworks.[dbo].[uspGetManagerEmployees] @ManagerID = 7'
  ,@DestDbName='tempdb'
  ,@tableName='dbo.t2'
  ,@additionalFieldNames='i int '
  ,@additionalFieldValues='1'
  ,@enums=3
